<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%@page import="avicit.platform6.core.locale.PlatformLocalesJSTL"%>
<%@page import="java.util.Locale"%>
<%@page import="avicit.platform6.api.session.SessionHelper"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="avicit.platform6.commons.utils.ViewUtil"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户权限设置</title>
<base href="<%=ViewUtil.getRequestPath(request)%>">
<%@page import="avicit.platform6.api.sysshirolog.impl.AfterLoginSessionProcess"%>
<% 
Object lang=session.getAttribute(AfterLoginSessionProcess.SESSION_CURRENT_LANGUAGE_CODE);
String languageCode="zh_CN";
if(lang!=null){
	languageCode=lang.toString();
}
	Locale locale =SessionHelper.getLocaleByUser(request);
%>
<link href="static/css/custom/lantop/css/custom.css" type="text/css"  rel="stylesheet">

<jsp:include page="/avicit/platform6/component/common/EasyUIJsInclude.jsp"></jsp:include>
<jsp:include page="/avicit/im/common/ImUIJSCSSInclude.jsp"></jsp:include>
<script type="text/javascript">
   authServiceId = "${param.authServiceId}";
</script>
<jsp:include page="/avicit/platform6/modules/system/commonpopup/commonSelectionHead.jsp"></jsp:include>
<script type="text/javascript" src="avicit/im/lantop/userauthset/UserAuthSetManage.js"></script>
<script type="text/javascript" src="avicit/im/lantop/userauthset/locale/language_<%=languageCode%>.js"></script>
<script type="text/javascript" src="static/js/platform/index/js/divscroll.js" ></script>
<script type="text/javascript" charset="utf-8">
  <%
	//页面过来接收参数
	String showTab = request.getParameter("showTab");
	String extParameter = request.getParameter("extParameter");
	String singleSelect = request.getParameter("singleSelect");
	String sysId = request.getParameter("sysId");
   %>	
   $(function(){
		var dataGridHeight = $(".easyui-layout").height();
		initTabContainer(dataGridHeight);
		$(".datagrid-view2").find(".datagrid-body").perfectScrollbar();
		$("#deptTab").perfectScrollbar();
   });
   var sysId = "<%=sysId%>";
   
</script>

<style>
 .searchbox{
   margin-top: 5px;
    border: 1px solid #dedede;
    border-radius: 4px;
 }
/*   #roleTab table.datagrid-htable {
    width: 100% !important;
}
#roleTab table.datagrid-btable {
    width: 100% !important;
} */
</style>
</head>
<body id="myBody" class="easyui-layout" fit="true">
 	<!-- 授权选择 begin -->
 	<%-- 授权选择 --%>
 	<div data-options="region:'west',title:'<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.authSelect","i18n.lantop",locale)%>',split:true" style="width:310px;">
 		<div id="comprehensiveTabControl" class="easyui-tabs" data-options="fit:true">
			<%-- 角色 --%>
			<div title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.authSelect.part","i18n.lantop",locale)%>"  id = "roleTab" data-options="iconCls:'icon-role',fit:true">
				<div id="roleToolbar" class="datagrid-toolbar" style="display: block;">
					<table class="tableForm" id="GroupSearchForm" width='100%'>
						<tr>
							<td width=""><input id="groupQueryText"></input></td>
						</tr>
					</table>
				</div>
				<table id="roleList" data-options="fit: true,fitColumns: true,scrollbarSize:0,"></table>
			</div>
			<%-- 部门 --%>
			<div title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.authSelect.dept","i18n.lantop",locale)%>" id = "deptTab" data-options="iconCls:'icon-dept',fit:true">
				<div id="deptToolbar" class="datagrid-toolbar" style="display: block;">
					<table class="tableForm" id="deptSearchForm" width='100%'>
						<tr>
							<td width=""><input id="deptQueryText"></input></td>
						</tr>
					</table>
				</div>
				<ul id="orgTree_dept" style="width: auto; overflow: auto;"></ul>
			</div>
			<%-- 用户 --%>
			<div title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.authSelect.user","i18n.lantop",locale)%>" id = "userTab" data-options="iconCls:'icon-user',fit:true">
				<div id="toolbarUser" class="datagrid-toolbar" style="display: block;">
					<table class="tableForm" id="userSearchForm" width='100%'>
						<tr>
							<sec:accesscontrollist hasPermission="3"><td width=""><input id="userQueryText"></input></td></sec:accesscontrollist>
							<%-- 选择部门 --%>
							<sec:accesscontrollist hasPermission="3"><td align="center" ><a class="easyui-linkbutton  selbtnc" iconCls='icon-org-dept' plain=true onclick="authSelectDept();" href="javascript:void(0);"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.authSelect.user.table.button.selectDept","i18n.lantop",locale)%></a><input type="hidden" id="authSelectedDeptId"/></td></sec:accesscontrollist>
						</tr>
					</table>
				</div>
				<table id="dgUser" class="easyui-datagrid"
						data-options="
							fit: true,
							border: false,
							rownumbers: true,
							animate: true,
							collapsible: false,
							fitColumns: true,
							scrollbarSize:0,
							autoRowHeight: false,
							toolbar:'#toolbarUser',
							idField :'ID',
							singleSelect: true,
							checkOnSelect:true,
							pagination:true,
							pageSize:dataOptions.pageSize,
							pageList:dataOptions.pageList,
							striped:true,
							url:'UserAuthSetController/getUsers.json?_status=1&id=${param.id}&type=${param.type}'">
						<thead>
							<tr>
								<th data-options="field:'ID', halign:'center',hidden:'true',checkbox:true,fit:true" width="220">id</th>
								<%-- 姓名 --%>
								<th data-options="field:'NAME',required:true,align:'center',fit:true" editor="{type:'text'}" width="220"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.authSelect.user.table.name","i18n.lantop",locale)%></th>
								<%-- 登录名 --%>
								<th data-options="field:'LOGIN_NAME',align:'center',align:'center',fit:true" editor="{type:'text'}"  width="220"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.authSelect.user.table.registerName","i18n.lantop",locale)%></th>
								<%-- 性别 --%>
								<th data-options="field:'SEX_NAME',align:'center',align:'center',fit:true" editor="{type:'text'}"  width="220"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.authSelect.user.table.gender","i18n.lantop",locale)%></th>
								<th data-options="field:'MOBILE',align:'center',align:'center',fit:true,hidden:true" editor="{type:'text'}"  width="220">手机</th>
								<%-- 部门 --%>
								<th data-options="field:'DEPT_NAME',align:'center',align:'center',fit:true" editor="{type:'text'}"  width="220"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.authSelect.user.table.dept","i18n.lantop",locale)%></th>
							</tr>
					    </thead>
				 </table>
			</div>
			<%-- 岗位 --%>
			<div title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.authSelect.post","i18n.lantop",locale)%>"  id = "positionTab" data-options="iconCls:'icon-position',fit:true">
				<div id="positionToolbar" class="datagrid-toolbar" style="display: block;">
					<table class="tableForm" id="positionSearchForm" width='100%'>
						<tr>
							<td width=""><input id="positionQueryText"></input></td>
						</tr>
					</table>
				</div>
				<table id="positionList" data-options="fit: true,fitColumns: true,scrollbarSize:0,"></table>
			</div>
		</div>	
		<!-- 授权选择 end -->
		
 		<!-- 权限服务datagrid已不在使用，默认为档案用户数据权限设置，js中有使用该datagrid事件，删除之前需要修改js -->
 		<div style="display: none;">
 		<!-- 权限服务 begin -->
		<div id="panelSearch" class="easyui-panel" title="权限服务"     
		        style="width:auto;height:auto;padding:0px;background:#fafafa;"   
		        data-options="collapsed:true,closable:false, collapsible:false"> 
 		</div>
		<div id="toolbarService" class="datagrid-toolbar" style="height: auto; display: block; padding-top: 5px">
			<input class="easyui-validatebox" id="serviceName" name="serviceName" style="200px;" />
		</div>
		<table id="serviceDatagrid" class="easyui-datagrid"
				data-options="
						url:'platform/UserAuthSetController/getAuthService?sysId=${param.sysId }',
						rownumbers: true,
						animate: false,
						collapsible: false,
						fitColumns: true,
						autoRowHeight: false,
						singleSelect: true,
						pagination:true,
						pageSize:10, 
						pageList:[5,10,20], 
						toolbar:'#toolbarService',
			    		striped:true,
						fit:true,
						method: 'post',
						onSelect: serviceOnSelect,
						onLoadSuccess: serviceOnLoadSuccess">
			<thead>
				<tr>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_UserAuthSetManage_serviceDatagrid_serviceId">
						<th data-options="field:'SERVICE_ID', halign:'center', hidden:true" title="主键ID" width="20">主键ID</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_UserAuthSetManage_serviceDatagrid_serviceName">
						<th data-options="field:'SERVICE_NAME', halign:'center', align:'center', sortable:false,editor:{type:'text'}"
							width="200" title="权限服务项目">权限服务项目</th>
					</sec:accesscontrollist>
				</tr>
			</thead>
		</table>
		</div>
		<!-- 权限服务 end -->
 	</div>   
    <div data-options="region:'center',split:true" style="height:0; overflow:hidden; font-size:0;padding:0px;">
		<iframe id="mainIframe" style="width: 100%; height: 100%; border: 0" frameborder="0"></iframe>
    </div>
</body>
</html>
